package com.settlement.system.service.impl;

import com.settlement.system.mapper.BaseMapper;
import com.settlement.system.mapper.TblRrAccountSubjectMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblRrAccountSubject;
import com.settlement.system.service.ITblRrAccountSubjectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;

/**
 * RR-会计科目 服务实现类
 * @author xiaochuan
 * @since 2023-10-17
 */
@Slf4j
@Service
public class TblRrAccountSubjectServiceImpl extends BaseServiceImpl implements ITblRrAccountSubjectService {

    @Resource
    private TblRrAccountSubjectMapper tblRrAccountSubjectMapper;

    @Override
    public BaseMapper init() {
        return tblRrAccountSubjectMapper;
    }


    @Override
    public TblRrAccountSubject selectExistSubject(TblRrAccountSubject subject) throws ServiceException {
        try {
            return tblRrAccountSubjectMapper.selectExistSubject(subject);
        } catch (Exception ex){
            log.error("selectExistSubject exception",ex);
            throw new ServiceException("selectExistSubject exception",ex);
        }
    }
}

